<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<script type="text/javascript">
<!--
	function _select(selectedIds, targetType) {
		var $gwName = $("#gwID").val();
		var $box = targetType == "dialog" ? $.pdialog.getCurrent() : navTab
				.getCurrentPanel();
		function _doPost() {
			var ids = new Array();
			$box.find("input:checked").filter("[name='" + selectedIds + "']")
					.each(function(i) {
						var val = $(this).val();
						ids[i] = val;
						i++;
					});
			if (ids.length > 0) {
				window.returnValue = ids;
				window.parent.addTable();
				$.pdialog.closeCurrent();//关闭dialog
			} else {
				alertMsg.error("未选择提交对象！");
				return false;
			}
		}
		var title = $box.find("a[rel='ids']").attr("title");
		if (title) {
			alertMsg.confirm(title, {
				okCall : _doPost
			});
		}
	}
//-->
</script>
<form id="pagerForm" method="post" action="ExamMain/plist">
	<input type="hidden" name="pageNum" value="${obj.pager.pageNumber}" />
	<input type="hidden" name="numPerPage" value="${obj.pager.pageSize}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
</form>
<div class="pageHeader">
	<form action="ExamMain/plist" method="post"
		onsubmit="return dialogSearch(this);">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>岗位信息：</td>
					<td><select name="gwID" class="combox" id="gwID">
							<option value="">岗位信息</option>
							<c:forEach var="di" items="${obj.gwinfo}">
								<option value="${di.ID}">${di.gwName}</option>
							</c:forEach>
					</select></td>
					<td>科目信息：</td>
					<td><select name="subjectID" class="combox">
							<option value="">科目信息</option>
							<c:forEach var="di" items="${obj.subject}">
								<option value="${di.subID}">${di.subName}</option>
							</c:forEach>
					</select></td>
					<td>难易程度:</td>
					<td><select name="ndxs" class="combox">
							<option value="">难易程度</option>
							<option value="初级">初级</option>
							<option value="中级">中级</option>
							<option value="高级">高级</option>
					</select></td>
					<td>题目类型：</td>
					<td><select name="type" class="combox">
							<option value="">选择题型</option>
							<option value="判断题">判断题</option>
							<option value="单选题">单选题</option>
							<option value="多选题">多选题</option>
							<option value="解答题">解答题</option>
					</select></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div></li>
					<li><div class="buttonActive">
							<div class="buttonContent">
								<button type="button" multLookup="orgId" warn="请选择部门">选择带回</button>
							</div>
						</div></li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li class="line">line</li>
			<li><a title="确实要添加这些记录吗?" rel="ids" targetType="dialog"
				href="javascript:_select('ids','dialog');" targetType="dialog"
				class="add"><span>提交试题 </span></a></li>
			<li class="line">line</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="26"><input type="checkbox" group="ids"
					class="checkboxCtrl"></th>
				<th>试题内容</th>
				<th>科目名称</th>
				<th>岗位信息</th>
				<th>难度系数</th>
				<th>类型</th>
				<th>备注信息</th>
			</tr>
		</thead>
		<!-- 
value="{id:'${acc.pID}',content:'${acc.pContent}',subjectName:'${acc.subjectName}',gwName:'${acc.gwName}'ndxs:'${acc.ndxs}',type:'${acc.type}'}"
		
							
		
		 -->
		<tbody>
			<c:forEach items="${obj.list}" var="acc">
				<tr target="sid_eaxm" rel="${acc.pID}">
					<td><input name="ids"
						value="${acc.pID}#${acc.pContent}#${acc.subjectName}#${acc.gwName}#${acc.ndxs}#${acc.type}"
						type="checkbox"></td>
					<td>${fn:substring(acc.pContent,0,25)}<b>. . .</b></td>
					<td>${acc.subjectName}</td>
					<td>${acc.gwName}</td>
					<td>${acc.ndxs}</td>
					<td>${acc.type}</td>
					<td>${acc.remark }</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span> <select class="combox" name="numPerPage"
				onchange="dialogPageBreak({numPerPage:this.value})">
				<c:forEach begin="10" end="40" step="10" varStatus="s">
					<option value="${s.index}"
						${obj.pager.pageSize eq s.index ? 'selected="selected"' : ''}>${s.index}</option>
				</c:forEach>
			</select> <span>条，共${obj.pager.recordCount}条</span>
		</div>

		<div class="pagination" targetType="dialog"
			totalCount="${obj.pager.recordCount}"
			numPerPage="${obj.pager.pageSize}" pageNumShown="20"
			currentPage="${obj.pager.pageNumber}"></div>

	</div>
</div>
